class Tile
{
  PImage TileImage;
  PVector TilePosition;
  int TileNumber;
  Boolean IsClicked;
  Tile(PImage image, int number,PVector position  )
  {
    //Ustawienie 0 tile na czarny czyli ten ktory mozemy ruszyc na poczatku
    if (number!=0)
    {
      TileImage=image;
      IsClicked=true;
    }
    else
    {
      IsClicked=false;
      TileImage=createImage(TILESIZE, TILESIZE, RGB);
      TileImage.loadPixels();
      for (int i = 0; i < TileImage.pixels.length; i++) {
        TileImage.pixels[i] = color(0, 0, 0);
      }
      TileImage.updatePixels();
    }
    //Dodanie ramek zeby było widać różnice pomiędzy tilami
    TileImage.loadPixels();
    for (int i = 0; i < sqrt (TileImage.pixels.length); i++) 
    {
      for (int j = 0; j < sqrt (TileImage.pixels.length); j++) 
      {
        if (i==0 || j==0 || i==TILESIZE || j==TILESIZE)
        {
          TileImage.pixels[i*TILESIZE+j] = color(0, 90, 102);
        }
      }
    }
    TileImage.updatePixels();    
    TileNumber=number;
    TilePosition=position;
  }
}

